home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / apmd.postinst < prev    next >
Encoding:
Text File  |  2007-03-05  |  2.1 KB  |  79 lines

  1. #!/bin/sh
  2. #
  3. # This is the postinst script for the Debian GNU/Linux apmd package
  4. #
  5. # Written by Dirk Eddelbuettel <edd@debian.org>
  6. # Debconf changes added by Chris Hanson <cph@debian.org>
  7.  
  8. set -e 
  9. umask 022
  10.  
  11. case "${1}" in
  12. (configure)
  13.     . /usr/share/debconf/confmodule || exit 0
  14.  
  15. # Rejection of APM events doesn't yet work; see apmd_proxy.
  16. #    CONFFILE=/etc/apm/apmd_proxy.conf
  17. #    TEMPLATE=/usr/share/apmd/apmd_proxy.conf
  18. #    SEDFILE="${CONFFILE}.sed.$$"
  19. #    TMPFILE="${CONFFILE}.tmp.$$"
  20. #
  21. #    trap "rm -f ${SEDFILE} ${TMPFILE}" EXIT INT QUIT TERM
  22. #
  23. #    db_get apmd/overwrite-config-file || true
  24. #    if [ "${RET}" = "true" ]; then
  25. #
  26. #    # Convert the debconf bindings to a sed script that will
  27. #    # insert the bindings into the configuration file.
  28. #    rm -f "${SEDFILE}" || true
  29. #    xfer_binding ()
  30. #    {
  31. #        db_get "${2}" || true
  32. #        echo "s%^${1}=\(.*\)\$%${1}=${RET}%;" >> "${SEDFILE}"
  33. #    }
  34. #    xfer_binding SUSPEND_ON_AC apmd/suspend-on-ac
  35. #
  36. #    # Apply the sed script to the template file to create the
  37. #    # configuration file.
  38. #    cat "${TEMPLATE}" | sed -f "${SEDFILE}" > "${TMPFILE}"
  39. #    rm -f "${SEDFILE}" || true
  40. #    mv -f "${TMPFILE}" "${CONFFILE}"
  41. #
  42. #    fi
  43.     db_stop
  44.     if [ -z "$(ls /etc/apm/suspend.d/*hwclock 2> /dev/null)" ]; then
  45.     mkdir -p /etc/apm/suspend.d
  46.     ln -sf ../scripts.d/hwclock /etc/apm/suspend.d/99hwclock
  47.     fi
  48.     if [ -z "$(ls /etc/apm/resume.d/*hwclock 2> /dev/null)" ]; then
  49.     mkdir -p /etc/apm/resume.d
  50.     ln -sf ../scripts.d/hwclock /etc/apm/resume.d/00hwclock
  51.     fi
  52.  
  53.     # Remove shutdown and reboot links; this init script does not need them.
  54.     if dpkg --compare-versions "$2" lt "3.2.2-7ubuntu1"; then
  55.     rm -f /etc/rc0.d/K20apmd /etc/rc6.d/K20apmd
  56.     fi
  57.     ;;
  58. (abort-upgrade|abort-remove|abort-deconfigure)
  59.     ;;
  60. (*)
  61.     echo "postinst called with unknown argument \`$1'" >&2
  62.     exit 1
  63.     ;;
  64. esac
  65.  
  66. # Automatically added by dh_installinit
  67. if [ -x "/etc/init.d/apmd" ]; then
  68.     update-rc.d apmd multiuser >/dev/null
  69.     if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
  70.         invoke-rc.d apmd start || exit $?
  71.     else
  72.         /etc/init.d/apmd start || exit $?
  73.     fi
  74. fi
  75. # End automatically added section
  76.  
  77.  
  78. exit 0
  79.